<?php defined("MAIN_DIR") or die("No direct access");

if (!$user->isAdmin() && $route->getPath(2) != "auth"){
	to("/admin/auth");
}

switch ($route->getPath(2)) {
	
	case "auth":	require_once ADMIN."auth".DS.MAINFILE; break;
	case "quotes":	require_once ADMIN."quotes".DS.MAINFILE; break;
	case "books":	require_once ADMIN."books".DS.MAINFILE; break;
	case "users":	require_once ADMIN."users".DS.MAINFILE; break;

	default: to("/admin/quotes/list");
}

?>